package tk.ewentsai.serves;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import tk.ewentsai.dao.OrderServiceImpl;
import tk.ewentsai.dao.OrdersServiceImpl;
import tk.ewentsai.pojo.Orders;

import javax.ws.rs.GET;
import java.util.ArrayList;

public class manageOrder {

    private static ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:application-context.xml");
    private static OrdersServiceImpl OrdersBean = applicationContext.getBean("ordersService",OrdersServiceImpl.class);
    private static OrderServiceImpl OrderBean = applicationContext.getBean("orderService",OrderServiceImpl.class);

    public static ArrayList<Orders> getOrdersByUid(int uid){ return OrdersBean.getOrdersByUid(uid); }
    public static ArrayList<Orders> getOrders(){ return OrdersBean.getAllOrders(); }
}
